<template>
  <div style="font-size:1rem">
    <div class="pay_money">
      <!-- <p>{{prescribeInfo.DURGSTORENAME}}</p> -->
      <!-- <p>￥{{prescribeInfo.PRESCRIPTION_PRICE}}</p> -->
      <p><span>处方医保审核结算中</span></p>
      <p>
         <yb-loading></yb-loading>
      </p>
      <p>
         <button @click="reload()" class="pay_bot_reload">刷   新</button>
      </p>
      
    </div>

    <div class="ybjs_notice">
      <p>医保结算结果将以短信或者短消息的方式通知您</p><br>
    </div>


    <div class="pay_bot_div">
      <button @click="$router.push({name:'chufang-prescribeRecord', query:{isshow:2}});" class="pay_bot_back">返   回</button>
    </div>


  </div>
</template>

<script>
import alertTip from '~/components/common/alertTip';
import ybLoading from '~/components/common/ybLoading';

const { config } = window;

export default {
  data() {
    return {

      ts: this.newStore(),
      tq: this.getData(),
      headTitle: '医保结算中',

      je_yh: 0, // 优惠金额
      prescribeInfo:{},
      ts: this.newStore(),
      tq: this.getData(),

    };
  },

  components: {
    alertTip,ybLoading,
  },
  methods: {


    /**
     * 刷新医保状态
     * 如果已经医保结算，跳转页面到医保结算页面
     */
    reload() {
      const DATA = {
        orderInfo: this.prescribeInfo.ORDERID,
      };
      this.tq.getOrderDetail(DATA,this).then((ts) => {
        console.log('刷新页面获取最新处方订单信息：' + JSON.stringify(ts.d));
        this.prescribeInfo = ts.d.DATAOBJ.DATA;

        if (this.prescribeInfo.YBJSZT == 'K') {
            this.$router.push({
              path: '/chufang/pay',
              query: {
                preinfostr: JSON.stringify({
                  ORDERID: this.prescribeInfo.ORDERID,
                })
              },
            });
        }

      });
    },



    closeTip() {
      this.showAlert = false;
    },
    created() {
      document.title = '处方医保结算中';
      this.$root.showfooter = false;
      this.hospitalName = sessionStorage.getItem('hosName');
    },
    destroyed() {
      this.$root.showfooter = true;
    },
  },
  mounted() {
    console.log("ybjs.vue ====" + this.$route.query.preinfostr);
    this.prescribeInfo=JSON.parse(this.$route.query.preinfostr);
    this.reload(); // 防止手机的上下翻页返回上一页
  },
  computed: {
    second() {
      return this.num(this.seconds);
    },
    minute() {
      return this.num(this.minutes);
    },
    je_sf() {
      // return Number(this.yff) + Number(this.jgf) + Number(this.psf) - Number(this.je_yh);
      return Number(this.yff);
    },
  },
};
</script>

<style scoped>
body {
  /* background: #f1f1f1; */
}
.ybjs_notice{
    display: flex;
    flex-direction: row;
    justify-content: center;
    font-size: .8rem;
    color: #666;
    margin: 2rem auto;
}
.pay_money {
  margin-top: 1rem;
  text-align: center;
}
.pay_money p{
  background: #fff;
  display: flex;
  flex-flow: column | nowrap;
  justify-content: center;
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.pay_money p:nth-child(1){
  font-size: 1.5rem;
  color: #000;
}
.pay_bot_div {
  width: 100%;
  text-align: center;
  position: fixed;
  bottom: 1rem;
}
.pay_bot_back {
  margin: 0 auto;
  width: 95%;
  text-align: center;
  line-height: 2.5rem;
  border-radius: 5px;
  /* margin-top: 0.8rem; */
  color: #fff;
  background: #ccc;
  letter-spacing: 1px;
/*   border: none;
  outline: none;
  bottom:0.4rem; */
}
.pay_bot_reload {
  margin: 0 auto 1rem auto;
  width: 30%;
  text-align: center;
  line-height: 2.5rem;
  border-radius: 5px;
  color: #fff;
  background: #5ea8bf;
  letter-spacing: 1px;
}
</style>
